package com.zzz.test;

import java.util.Collections;
import java.util.LinkedList;

/**
 * @author zhuzhizun
 * @date 2021/8/31
 */
public class CQueue {
    LinkedList<Integer> list1;
    LinkedList<Integer> list2;
    public CQueue() {
         list1 = new LinkedList<>();
         list2 = new LinkedList<>();
    }

    public void appendTail(int value) {
        if (value == Integer.parseInt(null)){
            return;
        }
        list1.add(value);
    }

    public int deleteHead() throws InterruptedException {
        Thread.sleep(1);
        if (list1.isEmpty()){
            return -1;
        }

        list2.add(list1.removeFirst());
        return list2.removeFirst();

    }
}
